import request from '@/utils/request'

// 查询作品管理列表
export function listWork(query) {
  return request({
    url: '/ai/work/list',
    method: 'get',
    params: query
  })
}

// 查询作品管理详细
export function getWork(workId) {
  return request({
    url: '/ai/work/' + workId,
    method: 'get'
  })
}

// 新增作品管理
export function addWork(data) {
  return request({
    url: '/ai/work',
    method: 'post',
    data: data
  })
}

// 修改作品管理
export function updateWork(data) {
  return request({
    url: '/ai/work',
    method: 'put',
    data: data
  })
}

// 删除作品管理
export function delWork(workId) {
  return request({
    url: '/ai/work/' + workId,
    method: 'delete'
  })
}

export function listCollect(query){
  return request({
    url: '/ai/work/listCollect',
    method: 'get',
    params: query
  })
}
export function addCollect(data){
  return request({
    url: '/ai/work/addCollect',
    method: 'post',
    data: data
  })
}

export function delCollect(data){
  return request({
    url: '/ai/work/removeCollect',
    method: 'delete',
    data: data
  })
}
export function listHistory(query){
  return request({
    url: '/ai/work/listHistory',
    method: 'get',
    params: query
  })
}
export function addHistory(data){
  return request({
    url: '/ai/work/addHistory',
    method: 'post',
    data: data
  })
}

export function delHistory(data){
  return request({
    url: '/ai/work/removeHistory',
    method: 'delete',
    data: data
  })
}

export function updateLike(data){
  return request({
    url: '/ai/work/updateLike',
    method: 'post',
    data: data
  })
}